import logging
import pygame
import olpcgames

log = logging.getLogger('game')
log.setLevel(logging.INFO)

class Game():
    
    def __init__(self):
        
        self.size = (800, 600)
        if olpcgames.ACTIVITY:
            self.size = olpcgames.ACTIVITY.game_size
            
        # screen represents a surface
        self.screen = pygame.display.set_mode(self.size)
        
        rect = self.screen.get_rect()
        self.size = rect.width, rect.height
        
        pygame.display.init()
        self.running = True
        
        self.clock = pygame.time.Clock()
        
        self.gui = gui.UI(self)
        
    def run(self):
        
        while self.running:
            
            for evt in [pygame.event.wait()] + pygame.event.get():
                
                if evt.type == pygame.QUIT:
                    self.running = False
                    
                    
            pygame.display.flip()
        
        
            
            

